<!DOCTYPE html>
<html>

<head>
    <!-- Standard Meta -->
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <!-- Site Properties -->
    <title>Login Example - Semantic</title>
    <link rel="stylesheet" type="text/css" href="static/semantic/dist/semantic.min.css">
    <script src="static/js/jQuery/jquery-2.2.0.min.js"></script>
    <style type="text/css">
    body {
        background-color: #DADADA;
    }
    
    body > .grid {
        height: 100%;
    }
    
    .image {
        margin-top: -100px;
    }
    
    .column {
        max-width: 450px;
    }
    </style>
</head>

<body>
    <div class="ui middle aligned center aligned grid">
        <div class="column">
            <h2 class="ui teal image header">
      <!-- <img src="" class="image"> -->
      <div class="content">
        用户登陆
      </div>
    </h2>
            <form class="ui large form" id="login">
                <div class="ui stacked segment">
                    <div class="field">
                        <div class="ui left icon input">
                            <i class="user icon"></i>
                            <input type="text" name="Username" placeholder="用户名">
                        </div>
                    </div>
                    <div class="field">
                        <div class="ui left icon input">
                            <i class="lock icon"></i>
                            <input type="password" name="Password" placeholder="密码">
                        </div>
                    </div>
                    <div class="ui fluid large teal submit button" onclick="Login('/login','login')">登陆</div>
                </div>
                <div class="ui error message"></div>
            </form>
            <div class="ui message">
                忘记密码 <a href="#">点击找回</a>
            </div>
        </div>
    </div>
</body>
<script>
$(function() {
    document.onkeydown = function(e) {
        var ev = document.all ? window.event : e;
        if (ev.keyCode == 13) {
            Login('/login', 'login');
        }
    }
});

function Login(url, formid) {
    $.ajax({
        type: "get",
        data: $("#" + formid).serialize(),
        url: url,
        success: function(data) {
            window.location.href = "/";
        }
    });
}
</script>

</html>
